/**
 * Created by Administrator on 2017/6/6.
 */

var Type={
    'FF':1,
    'FJ':2
}

var MJ = require('../MJ/MJ');

var ScoreRule = clone(MJ.ScoreRule);
ScoreRule.FF = 201;   //放风
ScoreRule.FJ = 202;   //放箭


var Task = clone(MJ.Task);


var Pattern = {
    'NONE': 0,                       // 不是可胡的牌型 0
    'NORMAL': MJ.Pattern.NORMAL,    // 平胡           1
    'PAIR7':2,

    'WHR':3,
    'HRGW':4,
    'SHR':5,
    'GSKH':6,

    'WHGSKH':7,
    'QPAIR7':8,          //清七对

    'HHPAIR7':9,        //豪华七对
};
var HuPattern = {
    'ONE':1,
    'TWO':2,
    'FOUR':4,
    'EIGHT':8
}
var Gang = clone(MJ.Gang);
Gang.HAN = 5;
Gang.HANS = 6;
Gang.HDIAN = 7;

var PatternScore = {};
PatternScore[Pattern.NORMAL] = 1;
PatternScore[Pattern.ZM] = 2;
PatternScore[Pattern.YOUJIN] = 3;
PatternScore[Pattern.SANJIN] = 3;
PatternScore[Pattern.EIGHTHUA] = 3;

var ItemScore = {};
ItemScore[ScoreRule.DEALER] = 8;
ItemScore[ScoreRule.XIAN] = 4;
ItemScore[ScoreRule.GANG] = 1;
ItemScore[ScoreRule.HUA] = 1;
ItemScore[ScoreRule.JIN] = 1;

ItemScore[Pattern.NORMAL] = 2;
ItemScore[Pattern.ZM] = 4;
ItemScore[Pattern.YOUJIN] = 6;
ItemScore[Pattern.SANJIN] = 6;
ItemScore[Pattern.EIGHTHUA] = 6;

var ScoreReason = {
    DH: MJ.Result.DH,  // 点胡/点炮
    ZM: MJ.Result.ZM,  // 自摸/被自摸
    YJ: 11,            //游金
    LZ: ScoreRule.LZ, // 庄家
    QG: ScoreRule.QG, // 抢杠
};


var GangScore = {};
GangScore[MJ.Gang.BA] = 1;
GangScore[MJ.Gang.AN] = 2;
GangScore[MJ.Gang.DIAN] = 1;
GangScore[MJ.Gang.ANS] = 2;

exports.ScoreRule = ScoreRule;
exports.Pattern = Pattern;
exports.PatternScore = PatternScore;
exports.ItemScore = ItemScore;
exports.ScoreReason = ScoreReason;
exports.GangScore = GangScore;
exports.Type = Type;
exports.Gang = Gang;
exports.HuPattern = HuPattern;